package com.cf.wim.controller;

import com.cf.user.login.service.TokenManager;
import com.cf.web.RequiredLogin;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;

import javax.servlet.http.HttpServletRequest;

/**
 * boot-awm-ImController
 *
 * @author <a href="2428922347@qq.com">Zhu mingming</a>
 * @info
 * @since 2018/7/9 下午 06:22
 */
@Slf4j
@RequestMapping("/im/back")
public class ImBackController {

    @Autowired
    private TokenManager tokenManager;

    @RequiredLogin
    @RequestMapping
    public String index(HttpServletRequest request) {
        return "redirect:/b-chat.html?token=" + tokenManager.getToken(request);
    }

}
